package org.zjx.entity;

import lombok.Data;
import org.zjx.dom4j.XmlField;

/**
 * 航点
 */
@Data
public  class WayPoint implements IWayPoint {
    // NPC对话,点击,光圈
    @XmlField
    private String type;
    @XmlField
    private INpc npc;
    @XmlField
    private Coordinate aperture; //光圈
    @XmlField
    private Coordinate startPoint;
    @XmlField
    private Coordinate clockPoint;

    private String startNote;
    private String endNote;
    private String room;

    public enum Type {
        npc(1),  //NPC对话
        outside(2), //点击
        aperture(3); //光圈

        private final int description;

        // Constructor to set the description for each type
        Type(int description) {
            this.description = description;
        }

        // Getter for description
        public int getDescription() {
            return description;
        }
        public static Type fromDescription(int description) {
            for (Type type : Type.values()) {
                if (type.getDescription() == description) {
                    return type;
                }
            }
            throw new IllegalArgumentException("无效的 description: " + description);
        }

        // Optional: You can override toString() to return a more readable value
        @Override
        public String toString() {
            return name() + ": " + description;
        }
    }
}
